from pydantic import BaseModel
from typing import List, Dict, Optional

class GPUStatus(BaseModel):
    isGpuBusy: bool
    deviceName: str
    status: str

class SQLQuery(BaseModel):
    sql: str

class QueryResponse(BaseModel):
    success: bool
    count: Optional[int] = None
    data: Optional[List[Dict]] = None
    error: Optional[str] = None

class ModelInfo(BaseModel):
    id: str
    name: str
    createdAt: str

class UploadResponse(BaseModel):
    success: bool
    filePath: str
    fileName: str

class StartJobRequest(BaseModel):
    taskType: str  # Training, Validation, Test
    dataFile: str
    params: Optional[Dict] = None
    modelId: Optional[str] = None

class JobResponse(BaseModel):
    success: bool
    jobId: str

class JobStatus(BaseModel):
    jobId: str
    status: str
    taskType: str
    progress: Optional[Dict] = None
    results: Optional[List[Dict]] = None
    message: str

class StopJobResponse(BaseModel):
    success: bool
    message: str

class PredictResponse(BaseModel):
    success: bool
    predictions: List[Dict[str, float]]

class AnalyzeRequest(BaseModel):
    analysisType: str
    data: Dict

class AnalyzeResponse(BaseModel):
    success: bool
    analysis: str

    